<?php
/**
 * Description of AccountRecord
 *
 * @author vzangloo
 */
class AccountRecord extends ActiveRecord {

    public function getAccountSquareLogo(){
        return empty($this->account)? null: $this->account->squarelogo;
    }
    
    public function getAccountLargeSquareLogo(){
        return empty($this->account)? null: $this->account->largeSquareLogo;
    }
    
    public function getAccountLogo(){
        return empty($this->account)? null: $this->account->logo;
        
        if(empty($this->account)){
            return empty($this->creator->account)? $this->creatorAvatar: $this->creator->account->logo;
        }else{
            return $this->account->logo;
        }
    }
    
    public function getAccountSmallLogo(){
        return empty($this->account)? null: $this->account->smallLogo;
    }
    
    public function getAccountMediumLogo(){
        return empty($this->account)? null: $this->account->mediumLogo;
    }
    
    public function getAccountOriginalLogo(){
        return empty($this->account)? null: $this->account->originalLogo;
    }
    
    public function getAccountLogoWidth(){
        if(empty($this->account)){
            return empty($this->creator->account)? $this->creatorAvatar: $this->creator->account->logoWidth;
        }else{
            return $this->account->logoWidth;
        }
    }
    
    public function getAccountLogoHeight(){
        if(empty($this->account)){
            return empty($this->creator->account)? $this->creatorAvatar: $this->creator->account->logoHeight;
        }else{
            return $this->account->logoHeight;
        }
    }
    
    public function getAccountName(){
        if(empty($this->account)){
            return empty($this->creator->account)? $this->creatorName: $this->creator->account->businessName;
        }else{
            return $this->account->businessName;
        }
    }
    
    public function getAccountDisplayName(){
        if(empty($this->account)){
            return empty($this->creator->account)? $this->creatorName: $this->creator->account->displayName;
        }else{
            return $this->account->displayName;
        }
    }    
    
    public function getAccountUrl() {
        if (empty($this->account)) {
            return empty($this->creator->account) ? '' : $this->creator->account->url;
        } else {
            return $this->account->url;
        }
    }

    public function getAccountType(){
        return empty($this->account)?null:$this->account->type;
    }
    
}